home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
archiver
/
unix
/
zip19p1.zoo
/
zip.doc
< prev
next >
Wrap
Text File
|
1992-08-26
|
24KB
|
529 lines
ZIP(1) USER COMMANDS ZIP(1)
NAME
zip, zipcloak, zipnote, zipsplit - package and compress
(archive) files
SYNOPSIS
zip [ -cdeEfghjklmoqruwyz@ ] [ -b temppath ] [ -n suffixes ]
[ -t mmddyy ] [ zipfile list ] [ -x list ]
zipcloak [ -d ] [ -b path ] zipfile
zipnote [ -w ] [ -b path ] zipfile
zipsplit [ -ti ] [ -n size ] [ -b path ] zipfile
DESCRIPTION
zip is a compression and file packaging utility for Unix,
VMS, MSDOS, OS/2, Windows NT, Minix, Atari and Macintosh.
It is analogous to a combination of tar and compress and is
compatible with PKZIP (Phil Katz ZIP) for MSDOS systems.
There is a companion to zip called unzip (of course) which
you should be able to find the same place you got zip. zip
and unzip can work with files produced by PKZIP under MSDOS,
and PKZIP and PKUNZIP can work with files produced by zip.
zip version 1.9 is compatible with pkzip 1.93a. Note that
pkunzip 1.10 cannot extract files produced by pkzip 1.93a or
zip 1.9. You must use pkunzip 1.93a or unzip 5.0 to extract
them.
For a brief help on zip and unzip, run each without specify-
ing any parameters on the command line.
zip puts one or more compressed files into a single "zip
file" along with information about the files, including the
name, path if requested, date and time last modified, pro-
tection, and check information to verify the fidelity of
each entry. zip can also be used as a filter, compressing
standard input to standard output. zip can pack an entire
directory structure in a zip file with a single command.
Compression ratios of 2:1 to 3:1 are common for text files.
zip has one compression method (deflation) and can also
store files without compression. It automatically chooses
the better of the two for each file to be compressed.
zip is useful for packaging a set of files to send to some-
one or for distribution; for archiving or backing up files;
and for saving disk space by temporarily compressing unused
files or directories.
HOW TO USE ZIP
The simplest use of zip is as follows:
zip stuff *
This will create the file "stuff.zip" (assuming it does not
exist) and put all the files in the current directory in
stuff.zip in a compressed form. The .zip suffix is added
automatically, unless that file name given contains a dot
already. This allows specifying suffixes other than ".zip".
Because of the way the shell does filename substitution,
files that start with a "." are not included. To include
those as well, you can:
zip stuff .* *
Even this will not include any subdirectories that are in
the current directory. To zip up an entire directory, the
command:
zip -r foo foo
will create the file "foo.zip" containing all the files and
directories in the directory "foo" that is in the current
directory. (The first "foo" denotes the zip file, the second
one denotes the directory.) The "r" option means recurse
through the directory structure. In this case, all the
files and directories in foo are zipped, including the ones
that start with a ".", since the recursion does not use the
shell's file-name substitution. You should not use -r with
the name ".*", since that matches ".." which will attempt to
zip up the parent directory--probably not what was intended.
You may want to make a zip file that contains the files in
foo, but not record the directory name, foo. You can use
the -j (junk path) option to leave off the path:
zip -j foo foo/*
The -y option (only under Unix) will store symbolic links as
such in the zip file, instead of compressing and storing the
file referred to in the link.
You might be zipping to save disk space, in which case you
could:
zip -rm foo foo
where the "m" option means "move". This will delete foo and
its contents after making foo.zip. No deletions will be
done until the zip has completed with no errors. This
option is obviously more dangerous and should be used with
care.
If the zip file already exists, these commands will replace
existing or add new entries to the zip file. For example,
if you were really short on disk space, you might not have
enough room simultaneously to hold the directory foo and the
compressed foo.zip. In this case, you could do it in steps.
If foo contained the subdirectories tom, dick, and harry,
then you could:
zip -rm foo foo/tom
zip -rm foo foo/dick
zip -rm foo foo/harry
where the first command would create foo.zip, and the next
two would add to it. At the completion of each zip command,
the directory just zipped would be deleted, making room in
which the next zip command could work.
zip will also accept a single dash ("-") as the zip file
name, in which case it will write the zip file to stdout,
allowing the output to be piped to another program. For
example:
zip -r - . | dd of=/dev/nrst0 obs=16k
would write the zip output directly to a tape with the
specified block size for the purpose of backing up the
current directory.
zip also accepts a single dash ("-") as the name of a file
to be compressed, in which case it will read the zip file
from stdin, allowing zip to take input from another program.
For example:
tar cf - . | zip backup -
would compress the output of the tar command for the purpose
of backing up the current directory. This generally produces
better compression than the previous example using the -r
option, because zip can take advantage of redundancy between
files. The backup can be restored using the command
unzip -p backup | tar xf -
When no zip file name is given and stdout is not a terminal,
zip acts as a filter, compressing standard input to standard
output. For example,
tar cf - . | zip | dd of=/dev/nrst0
is equivalent to
tar cf - . | zip - - | dd of=/dev/nrst0
Zip archives created in this manner can be extracted with
the program funzip which is provided in the unzip package.
For example,
dd if=/dev/nrst0 | funzip | tar xvf -
MODIFYING EXISTING ZIP FILES
When given the name of an existing zip file with the above
commands, zip will replace identically named entries in the
zip file or add entries for new names. For example, if
foo.zip exists and contains foo/file1 and foo/file2, and the
directory foo contains the files foo/file1 and foo/file3,
then:
zip -r foo foo
will replace foo/file1 in foo.zip and add foo/file3 to
foo.zip. After this, foo.zip contains foo/file1, foo/file2,
and foo/file3, with foo/file2 unchanged from before.
When changing an existing zip file, zip will write a tem-
porary file with the new contents, and only replace the old
one when the zip has completed with no errors. You can use
the -b option to specify a different path (usually a dif-
ferent device) to put the temporary file in. For example:
zip -b /tmp stuff *
will put the temporary zip file and the temporary compres-
sion files in the directory "/tmp", copying over stuff.zip
in the current directory when done.
If you are only adding entries to a zip file, not replacing,
and the -g option is given, then zip grows (appends to) the
file instead of copying it. The danger of this is that if
the operation fails, the original zip file is corrupted and
lost.
There are two other ways to change or add entries in a zip
file that are restri